//
//  JRefreshVCControl.h
//  jhf
//
//  Created by 计海峰 on 2017/11/23 14:05:37.
//  Copyright © 2017年 计海峰. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class EmptyData,UrlNeeded;
@interface JRefreshVCControl : NSObject

//UI 可不传 默认 0000
@property (nonatomic , assign) UIEdgeInsets padding;

//controller 标题 尽量传 可不传
@property (nonatomic , copy) NSString  *title;

//适合IOS7的侧滑删除按钮 可不传
@property (nonatomic , copy)  NSString  *deleteString;
//IOS8（包含IOS8）以上用的侧滑多个按钮  可不传
@property (nonatomic , strong) NSMutableArray <NSString *> *sideBtns;
//IOS8（包含IOS8）以上用 侧滑多个按钮  可不传
@property (nonatomic , strong) NSMutableArray <UIColor *> *sideBtnBgColor;

//转成model的名字 尽量传 可不传
@property (nonatomic , copy)  NSString  *modelName;

//cell高度 必传 传0表示自动算高度
@property (nonatomic , assign) float cellHeight;

//空数据显示 需要就传 可不传
@property (nonatomic , strong) EmptyData *emptyData;

//table 必传
@property (nonatomic , copy)  NSString  *tableCellName;

//接口信息 必传
@property (nonatomic , strong) UrlNeeded *urlNeeded;

//如果需要添加附加属性 传参数  需要传参数  则key和value 必须同时传
@property (nonatomic , copy) NSString *key;

@property (nonatomic , strong) id value;

//初始化控制信息
+ (JRefreshVCControl *)instanceWithTitle:(NSString *)title andCellName:(NSString  *)tableCellName andCellHeight:(float)cellHeight andUrlNeeded:(UrlNeeded *)urlNeeded;

@end


@interface EmptyData : NSObject
//空数据显示标题
@property (nonatomic , copy)  NSString  *emptyTitle;
//空数据显示图片
@property (nonatomic , copy)  NSString  *emptyImage;
//初始化空数据
+ (EmptyData *)instanceWithTitle:(NSString *)title andImageName:(NSString *)name;

@end

@interface UrlNeeded : NSObject

//标记 -1  不要下拉上拉 0只有下拉 1上拉和下拉 都会有 必传
@property (nonatomic , assign) NSInteger page;
//每页多少条 可不传 默认10条 可不传
@property (nonatomic , assign) NSInteger pageNum;
//返回list的key 如果没有 则不传
@property (nonatomic , copy) NSString  *pageKey;
//接口信息 必传
@property (nonatomic , copy) NSString  *url;
//接口参数 必传
@property (nonatomic , strong) NSDictionary  *param;
//提示信息 必传
@property (nonatomic , copy) NSString *message;
//是否缓存 0、不执行任何缓存策略  1、取缓存但是刷新数据 2、只取缓存
@property (nonatomic, assign) NSInteger isCache;
//list放在字段中 字段的名字 直接跟目录就不传 有就必传  例如 { dataKey : [@"1", @"2", @"3", @"4"] }
@property (nonatomic , copy) NSString *dataKey;


//初始化空数据
+ (UrlNeeded *)instanceWithUrl:(NSString *)url andParam:(NSDictionary *)param andPage:(NSInteger)page andPageNum:(NSInteger)pageNum andPageKey:(NSString *)pageKey andMessage:(NSString *)message;

//初始化空数据
+ (UrlNeeded *)instanceWithUrl:(NSString *)url andParam:(NSDictionary *)param andPage:(NSInteger)page;

@end
